When generating an exception frame for injection into a
authorkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Tue, 30 Aug 2005 16:53:40 +0000 (16:53 +0000)
committerkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Tue, 30 Aug 2005 16:53:40 +0000 (16:53 +0000)
guest, that frame's base should be aligned on a 16-byte
boundary (as is done by the hardware).

Signed-off-by: Jan Beulich <jbeulich@novell.com>
xen/arch/x86/x86_64/entry.S

index e1f39aa3cd51c693544187cde994fba51d7c7872..6d8fb1bac9fc3a6b42282edd4021346fa4e85d36 100644 (file)
@@ -339,7 +339,8 @@ create_bounce_frame:
 1:      /* In kernel context already: push new frame at existing %rsp. */
         movq  UREGS_rsp+8(%rsp),%rsi
         andb  $0xfc,UREGS_cs+8(%rsp)    # Indicate kernel context to guest.
-2:      movq  $HYPERVISOR_VIRT_START,%rax
+2:      andq  $~0xf,%rsi                # Stack frames are 16-byte aligned.
+        movq  $HYPERVISOR_VIRT_START,%rax
         cmpq  %rax,%rsi
         jb    1f                        # In +ve address space? Then okay.
         movq  $HYPERVISOR_VIRT_END+60,%rax